<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>用户管理</title>
		<meta name="renderer" content="webkit">
  		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<!-- 项目基准路径 -->
		<base href="/bestinc/"/>
		<!-- 引入layui的css -->
		<link rel="stylesheet" href="static/layui/css/layui.css"  media="all">
		<!-- 引入自定义工具css -->
		<link rel="stylesheet" href="static/css/util.css"  media="all">
		<!-- 引入jqeury -->
		<!-- <script src="js/util/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script> -->
		
		<!-- 引入layui的js -->
		<script src="static/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		
		<!-- 引入资源js -->
		<script src="static/js/system/user/user.js" type="text/javascript" charset="utf-8"></script>
		
		<!-- 解决图片展示表格框样式问题，如显示不完整，优先级等... -->
		<style type="text/css">
   			 .layui-table-cell{
	    	text-align:center;
	    	height: auto;
	   	 	white-space: normal;
   		 	}
		</style>
	</head>
	<body>
	<div id="content">
		<!-- 头部搜索框 -->
		<div id="search-header">
		  <form class="layui-form">
		      <div class="layui-form-item" style="">
		        <div class="layui-inline">
		          <label class="layui-form-label">用户姓名</label>
		          <div class="layui-input-inline">
		            <input id="queryUserName" type="text" name="userName" placeholder="请输入用户名字" autocomplete="off" class="layui-input">
		          </div>
		        </div>
		         <div class="layui-inline">
		          <label class="layui-form-label">组织名字</label>
		          <div class="layui-input-inline">
		            <select name="orgName" id="queryOrgName">
		              <option value="">请选择</option>
		            </select>
		          </div>
		          </div> 
		          <div class="layui-inline">
		          <label class="layui-form-label">用户性别</label>
		          <div class="layui-input-inline">
		            <select name="userSex" id="queryUserSex">
		              <option value="">请选择</option>
		              <option value="男">男</option>
		              <option value="女">女</option>
		            </select>
		          </div>
		          </div> 
		           <div class="layui-inline">
		          <label class="layui-form-label">是否可用</label>
		          <div class="layui-input-inline">
		            <select name="useable" id="queryUseable">
		              <option value="">请选择</option>
		              <option value="Y">可用</option>
		              <option value="N">禁用</option>
		            </select>
		          </div>
		          </div> 
		        <div class="layui-inline">
		          <label class="layui-form-label"></label>
		           <div class="layui-input-inline">
		            <button class="layui-btn" lay-submit="" lay-filter="userSearchBtn">
		            	<i class="layui-icon layui-icon-search"></i>
		            	查询
		            </button>
		           <button class="layui-btn "  type="reset">
		            	<i class="layui-icon layui-icon-refresh"></i>
		            	重置
		            </button>
		          </div>
		        </div>
		        
		      </div>
	      </form>
	    </div>
	    
		
		<!-- 数据表格 -->
		<div id="dataTable">
		<table class="layui-hide" id="userTable" lay-filter="userTableEvent">
		</table>
		</div>
		
		<!-- 添加模态框 -->
		<div id="addUserModal" class="definedModal">
			<!-- 这里手动加表单样式 -->
			<form id="addUserForm" lay-filter="addUserForm" class="layui-form" action="">
			 <!-- <div class="layui-form-item">
			    <label class="layui-form-label">用户Id</label>
			    <div class="layui-input-block">
			      <input type="text" name=userId lay-verify="required" placeholder="请输入用户ID" autocomplete="off" class="layui-input">
			    </div>
			  </div> -->
			  <div class="layui-form-item">
			    <label class="layui-form-label">用户名字</label>
			    <div class="layui-input-block">
			      <input type="text" name=userName lay-verify="required" placeholder="请输入用户名字" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">用户密码</label>
			    <div class="layui-input-block">
			      <input type="password" name="password" lay-verify="required|pass"  placeholder="请输入密码" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">用户电话</label>
			    <div class="layui-input-block">
			      <input type="text" name="userPhone" id="userPhone" lay-verify="required|phone|mobile"  placeholder="请选择" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">组织名字</label>
			    <div class="layui-input-block">
			      <select name="orgId" id="addOrgName">
		              <option value="">请选择</option>
		            </select>
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">用户性别</label>
			    <div class="layui-input-block">
					<select name="userSex">
		              <option value="">请选择</option>
		              <option value="男">男</option>
		              <option value="女">女</option>
		            </select>			   
		             </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">出生日期</label>
			    <div class="layui-input-block">
			      <input type="text"name="userBirthdate" id="addUserBirthdate" lay-verify="required"  placeholder="请选择" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">入职日期</label>
			    <div class="layui-input-block">
			      <input type="text"  name="userHiredate" id="addUserHiredate" lay-verify="required"  placeholder="请选择" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <!--************这里是上传图片的代码***************-->
    <!--************这里添加的隐藏的输入框，用来传递images的参数***************-->
			    <div class="layui-form-item">
			        <label class="layui-form-label ">用户头像</label>
			        <div class="layui-upload">
			            <button type="button" class="layui-btn" id="test1">上传图片</button>
			            <div class="layui-upload-list" align="center">
			              <div id="img">  <img class="layui-upload-img" id="demo1"  style="width: 50px" style="height: 50px"/></div>
			                <p id="demoText"></p>
			            </div>
			        </div>
			    </div>
			  <div class="layui-form-item layui-form-text">
			    <label class="layui-form-label">用户描述</label>
			    <div class="layui-input-block">
			      <textarea name="description" placeholder="请输入内容" class="layui-textarea"></textarea>
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <div class="layui-input-block">
			      <!-- <button type="submit" class="layui-btn" lay-submit="" lay-filter="addUserBtn">添加</button> -->
			      <button type="submit" class="layui-btn my-bg-green layui-btn-sm" lay-submit="" lay-filter="addUserBtn">添加</button>
			      <!-- <button type="button" class="layui-btn modalClose">关闭</button> -->
			      <button type="button" class="layui-btn modalClose layui-bg-orange layui-btn-sm">关闭</button>
			    </div>
			  </div>
			</form>
		</div>
		<!-- 修改模态框 -->
		<div id="updateUserModal" class="definedModal">
			<!-- 这里手动加表单样式 -->
			<form id="updateUserForm" lay-filter="updateUserForm" class="layui-form" action="">
			
			      <input type="hidden" name=userId lay-verify="required" placeholder="请输入用户ID" autocomplete="off" class="layui-input">
					<input type="hidden" name="_method" value="PUT"/>
			  <div class="layui-form-item">
			    <label class="layui-form-label">用户名字</label>
			    <div class="layui-input-block">
			      <input type="text" name=userName lay-verify="required" placeholder="请输入用户名字" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">用户密码</label>
			    <div class="layui-input-block">
			      <input type="password" name="password" lay-verify="required|pass"  placeholder="请输入密码" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">用户电话</label>
			    <div class="layui-input-block">
			      <input type="text" name="userPhone" lay-verify="required|phone"  placeholder="请输入用户电话" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">组织名字</label>
			    <div class="layui-input-block">
			      <select name="orgId" id="updateOrgName">
		              <option value="">请选择</option>
		            </select>
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">用户性别</label>
			    <div class="layui-input-block">
					<select name="userSex">
		              <option value="">请选择</option>
		              <option value="男">男</option>
		              <option value="女">女</option>
		            </select>			   
		             </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">出生日期</label>
			    <div class="layui-input-block">
			      <input type="text"name="userBirthdate" id="updateUserBirthdate" lay-verify="required"  placeholder="请输入出生日期" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">入职日期</label>
			    <div class="layui-input-block">
			      <input type="text"  name="userHiredate" id="updateUserHiredate" lay-verify="required"  placeholder="请输入入职日期" autocomplete="off" class="layui-input">
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <label class="layui-form-label">是否可用</label>
			    <div class="layui-input-block">
					<select name="useable">
		              <option value="">请选择</option>
		              <option value="Y">可用</option>
		              <option value="N">禁用</option>
		            </select>			   
		             </div>
			  </div>
			  <div class="layui-form-item layui-form-text">
			    <label class="layui-form-label">用户描述</label>
			    <div class="layui-input-block">
			      <textarea name="description" placeholder="请输入内容" class="layui-textarea"></textarea>
			    </div>
			  </div>
			  <div class="layui-form-item">
			    <div class="layui-input-block">
			      <!-- <button type="submit" class="layui-btn" lay-submit="" lay-filter="updateUserBtn">修改</button>
			      <button type="button" class="layui-btn modalClose">关闭</button> -->
			      <button type="submit" class="layui-btn  my-bg-green" lay-submit="" lay-filter="updateUserBtn">修改</button>
				  <button type="button" class="layui-btn layui-bg-orange modalClose">关闭</button>
			    </div>
			  </div>
			</form>
		</div>
		
	    <!-- 头部工具栏 -->
		<script type="text/html" id="userToolbar">
  			<div class="layui-btn-group">
				<span class="btnCont" style="display: none;">
 					<button title="添加"  lay-event="addUser" class=" layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe654;</i>添加</button>
					<button title="修改"  lay-event="updateUser" class=" layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe642</i>修改 </button>
					<button title="修改"  lay-event="frozenRecord" class=" layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe702;</i>禁用 </button>
					<button title="修改"  lay-event="restoreRecord" class=" layui-btn layui-btn-primary layui-btn-sm"><i class="layui-icon">&#xe666;</i>恢复 </button>
				</span>
  			</div>
		</script>
		<!-- 状态 -->
		<!--  -->
		<!-- <input type="checkbox" lay-filter="useable" value="{{d.userId}}" lay-skin="switch" lay-text="可用|禁用" {{d.useable=='Y'?'checked':''}}/> -->
		<script type="text/html" id="checkboxTpl">
			
			<span {{d.useable=='Y'? 'class="useable font-color font-size my-bg-green"': 'class="useable font-color font-size my-bg-red"'}}>{{d.useable=='Y'?'可用':'禁用'}}</span>
		</script>
		
		<!-- 工具栏列 -->
		<script type="text/html" id="resourceBar">
  			<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
		</script>
		</div>
		
		<!-- 引入按钮权限控制js -->
		<script src="static/js/system/power/authorityControl.js" type="text/javascript" charset="utf-8"></script>
	</body>
</html>
